import http from './http'

/* ------------------------------------ 文章 ------------------------------------ */
export const postPublishArticle = (obj) => {
  return http({
    url: '/article',
    method: 'post',
    data: obj
  })
}

export const delAbolishArticle = (obj) => {
  return http({
    url: '/article',
    method: 'delete',
    data: obj
  })
}

export const getQrCode = (param) => {
  return http({
    url: '/article/qrcode',
    method: 'get',
    responseType: 'blob',
    params: param
  })
}

export const getWebUrl = (param) => {
  return http({
    url: '/article/weburl',
    method: 'get',
    params: param
  })
}
/* ------------------------------------ 草稿 ------------------------------------ */
export const getDraftList = (param) => {
  return http({
    url: '/article/draft/list',
    method: 'get',
    params: param
  })
}

export const getDraftOne = (param) => {
  return http({
    url: '/article/draft',
    method: 'get',
    params: param
  })
}

export const getDraftStatistics = (param) => {
  return http({
    url: '/article/draft/statistics/all',
    method: 'get',
    params: param
  })
}

export const postDraftContent = (obj) => {
  return http({
    url: '/article/draft',
    method: 'post',
    data: obj
  })
}

export const putDraftInfo = (obj) => {
  return http({
    url: '/article/draft/info',
    method: 'put',
    data: obj
  })
}

export const putDraftContent = (obj) => {
  return http({
    url: '/article/draft/content',
    method: 'put',
    data: obj
  })
}

export const getDownload = (param) => {
  return http({
    url: '/article/draft/download',
    method: 'get',
    params: param
  })
}
/* ------------------------------------ 草稿日志 ------------------------------------ */

export const getDraftLogList = (param) => {
  return http({
    url: '/article/draft/log/list',
    method: 'get',
    params: param
  })
}